package com.cardmanager.pro.pojo.schedule;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.inferred.freebuilder.FreeBuilder;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalTime;


/**
 * 还款计划项。
 *
 * @author Fuchun
 * @since 1.0
 */
@FreeBuilder
@JsonDeserialize(builder = ItemPart.Builder.class)
public interface ItemPart extends Serializable {


    LocalDateTime getDateTime();

    @JsonIgnore
    default LocalTime getTime() {
        return getDateTime().toLocalTime();
    }

    ItemAction getAction();

    BigDecimal getAmount();

    /** 手续费。*/
    BigDecimal getCommission();

    /** 交易费 */
    BigDecimal getTradingFee();

    class Builder extends ItemPart_Builder {}
}
